import React, { memo, useState } from 'react'

const Son = memo(() => {
  console.log('123456')
  return <div>123456789</div>
})

export default function Memo() {
  const [num, setNum] = useState(1)
  const changeNum = () => {
    setNum(num + 1)
  }
  return (
    <div>
      <h1>{num}</h1>
      <button onClick={changeNum}>按钮</button>
      <br />
      <Son />
    </div>
  )
}
